package com.ymanage.controller;


import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.ymanage.entity.Order;
import com.ymanage.entity.User;
import com.ymanage.service.OrderServices;
import com.ymanage.service.UserService;

@Controller
//@RequestMapping("/templates")
public class UserController {

	@Autowired
	private UserService userService;
	

	@RequestMapping("/login.do")
	public ModelAndView getUser(HttpServletRequest request, String uname) {

		/*User user = userService.getUser(uid);
		if (user == null) {
			return "login.jsp";
		}
		request.getSession().setAttribute("loginUser", user);
		System.out.println(user.getUname());*/
		
		List<Integer> list = new ArrayList<Integer>();
		for(int i=0;i<11;i++){
			list.add(i);
		}
		
		ModelAndView mv = new ModelAndView();
		mv.setViewName("test");
		mv.addObject("uname",uname);
		mv.addObject("list",list);
		return mv;
	}

}
